package com.xzy.service.impl;

import com.xzy.custom.Page;
import com.xzy.entities.SysRole;
import com.xzy.mapper.SysRoleMapper;
import com.xzy.service.SysRoleService;
import com.xzy.web.form.SysRoleForm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * TODO
 *
 * @author XiangZhongyi
 * ClassName: 权限管理业务逻辑类
 * date: 2021/9/20 20:15
 */
@Service
public class SysRoleServiceImpl implements SysRoleService {

    @Autowired
    private SysRoleMapper sysRoleMapper;

    @Override
    public Integer findAllUserTypeCount(Page page,String name) {
        return sysRoleMapper.findAllUserTypeCount(page,name);
    }

    @Override
    public List<SysRole> findAllUserType(Page page,String name) {
        return sysRoleMapper.findAllUserType(page,name);
    }

    @Override
    public SysRole findById(Integer id) {
        return sysRoleMapper.findById(id);
    }

    @Override
    public void updateById(SysRoleForm form) {
        sysRoleMapper.updateById(form);
    }

    @Override
    public void insertType(SysRoleForm form) {
        sysRoleMapper.insertType(form);
    }

    @Override
    public void deleteById(int parseInt) {
        sysRoleMapper.deleteById(parseInt);
    }

    @Override
    public List<SysRole> findAllUserType1() {
        return sysRoleMapper.findAllUserType1();
    }

    @Override
    public SysRole findByRole() {
        return sysRoleMapper.findByRole();
    }

    @Override
    public List<SysRole> findByUserId(Integer id) {
        return sysRoleMapper.findByUserId(id);
    }
}
